<h2>Bookmarked authors</h2>

<div id="authors_bookmarked" class="alternate_table">
  <table cellpadding="0" cellspacing="0">
    <tbody>
      <?php foreach($pager->getResults() as $i => $author): ?>
          <tr class="<?php echo ($i%2==0)?'even':'odd' ?>">
            <td>
              <p>
                <a href="<?php echo url_for('author_show', $author) ?>">
                  <?php echo $author->getName() ?>
                </a>
              </p>
            </td>
            <td class="right_sided">
              <a class="remove_book" href="<?php echo url_for('profile/removeAuthorBookmark?author_id='.$author->getId()) ?>"></a>
            </td>
          </tr>
      <?php endforeach ?>
    </tbody>

    <tfoot>
      <tr>
        <td colspan="2" class="bottom_row">
          <?php if ($pager->haveToPaginate()): ?>
            <div class="pagination">
              <a href="<?php echo url_for('profile_author_bookmarks').'?page=1' ?>">
                << First
              </a>

              <a href="<?php echo url_for('profile_author_bookmarks').'?page='.$pager->getPreviousPage() ?>">
                < Previous
              </a>

              <?php if($pager->getPage() > 3): ?> ... <?php endif ?>

              <?php foreach ($pager->getLinks() as $page): ?>
                <?php if ($page == $pager->getPage()): ?>
                  <?php echo $page ?>
                <?php else: ?>
                  <a href="<?php echo url_for('profile_author_bookmarks').'?page='.$page ?>">
                    <?php echo $page ?>
                  </a>
                <?php endif ?>
              <?php endforeach ?>

              <?php if($pager->getLastPage() - $pager->getPage() > 3): ?> ... <?php endif ?>
              <a href="<?php echo url_for('profile_author_bookmarks').'?page='.$pager->getNextPage() ?>">
                Next >
              </a>

              <a href="<?php echo url_for('profile_author_bookmarks').'?page='.$pager->getLastPage() ?>">
                Last >>
              </a>
            </div>
          <?php endif; ?>

          <div class="pagination_desc">
            <strong><?php echo count($pager) ?></strong> bookmarks
            <?php if ($pager->haveToPaginate()): ?>
              - page <strong><?php echo $pager->getPage() ?> of <?php echo $pager->getLastPage() ?></strong>
            <?php endif; ?>
          </div>
        </td>
      </tr>
    </tfoot>
  </table>
</div>
